package com.cskaoyan.controller;

import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.service.AddressService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


@RestController
@RequestMapping("/admin/address")
public class AddressController {

    @Autowired
    AddressService addressService;
    @RequiresPermissions("admin:address:list")
    @GetMapping("/list")
    public Object list(Integer userId,
                       String name,
                       Integer page,
                       Integer limit,
                       String sort,
                       String order) {

        Map<String, Object> res = addressService.querySelective(userId, name, page, limit, sort, order);
        return BaseRespVo.success(res);
    }

}
